package com.myl.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.myl.core.basic.BaseEntity;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 后台权限菜单节点
 * </p>
 *
 * @author Myl <ixiaomu@qq.com>
 * @since 2024-01-10 11:21
 */
@Data
@Accessors(chain = true)
@Schema(name = "权限节点", description = "后台权限菜单节点")
@TableName("myl_sys_menu")
public class SysMenu extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "节点名称不能为空")
    @Schema(description = "节点名称")
    @TableField("name")
    private String name;

    @Schema(description = "上级菜单")
    @TableField("pid")
    private Long pid;

    @Schema(description = "图标")
    @TableField("icon")
    private String icon;

    @Schema(description = "节点地址")
    @TableField("perms")
    private String perms;

    @Schema(description = "权重（排序）")
    @TableField("sort")
    private Byte sort;

    @Schema(description = "是否显示1是0否")
    @TableField("is_show")
    private Integer is_Show;

    @Schema(description = "权限类型: M=目录，C=菜单，A=按钮")
    @TableField("menu_type")
    private String menuType;

    @Schema(description = "权限类型: M=目录，C=菜单，A=按钮")
    @TableField(exist = false)
    private List<String> children;
}
